package com.gxa.meiye.admin.service.impl;

import com.gxa.meiye.admin.mapper.OrdersMapper;
import com.gxa.meiye.admin.service.OrdersService;
import com.gxa.meiye.core.pojo.domain.OrderInfo;
import com.gxa.meiye.core.pojo.domain.OrderdetailedInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author cc
 * @PackageName meiye
 * @Package com.gxa.meiye.admin.service.impl
 * @Date 2022/7/27 14:05
 * @Version 1.0
 */
@Service
public class OrdersServiceImpl implements OrdersService {
    @Resource
    private OrdersMapper ordersMapper;

    @Override
    public List<OrderInfo> findByTherapistId(Integer id) {
        return this.ordersMapper.queryOrderByTherapistId(id,2);
    }

    @Override
    public boolean updateStatusById(Integer id,Integer status) {
        Integer update = this.ordersMapper.updateStatusById(id,4);
        if (update==0){
            return false;
        }
        return true;
    }

    @Override
    public String getConsumerPhone(Integer id) {
        return this.ordersMapper.getConsumerPhone(id);
    }

    @Override
    public List<OrderInfo> myOrder(Integer id) {
        return this.ordersMapper.queryOrderInTherapist(id);
    }

    @Override
    public OrderdetailedInfo getDetailedInfo(Integer id) {
        return this.ordersMapper.queryOrderInfo(id);
    }
}
